package br.ufc.parser;


public class CustomStatement {
	
	private String sql;
	private boolean isSelect;
	private boolean isInsert;
	
	public CustomStatement (String sql){
		this.sql = sql.trim().toLowerCase();
		this.isSelect = false;
		this.isInsert = false;
		if(this.sql.startsWith("select")){
			this.isSelect = true;
		} else if(this.sql.startsWith("insert")){
			this.isInsert = true;
		}
	}
	
	public boolean isSelect(){
		return isSelect;		
	}
	
	public boolean isInsert(){
		return isInsert;
	}
	
	public Query getSelect(){
		if(isSelect()){
			return new Query(sql);
		}
		return null;
	}
	public CustomInsert getInsert(){
		if(isInsert()){
			return new CustomInsert(sql);
		}
		return null;
	}
}
